package com.study.example.gameserver.module.attr.domain;

import com.sparrow.common.attr.domain.AttrScope;
import com.sparrow.common.attr.domain.IAttrType;
import com.sparrow.common.value.EnumValue;
import com.sparrow.common.value.EnumUtil;

/**
 * 属性类型
 */
public enum AttrType implements EnumValue, IAttrType {
    /**
     * 攻击
     */
    Atk(1, false, null, null),
    /**
     * 防御
     */
    Def(2, false, null,null),
    /**
     * 生命
     */
    Hp(3, false, null,null);

    private final int code;
    private final boolean percent;
    private final AttrType baseType;
    private final AttrScope percentScope;

    AttrType(int code, boolean percent, AttrType baseType, AttrScope percentScope) {
        this.code = code;
        this.percent = percent;
        this.baseType = baseType;
        this.percentScope = percentScope;
    }

    @Override
    public int value() {
        return code;
    }

    public static void main(String[] args) {
        AttrType attrType = EnumUtil.valueOf(AttrType.class, 1);
        System.out.println(attrType);
    }

    @Override
    public int getType() {
        return code;
    }

    @Override
    public boolean isPercent() {
        return false;
    }

    @Override
    public IAttrType affectType() {
        return null;
    }

    @Override
    public AttrScope getPercentScope() {
        return null;
    }
}
